package cn.csg.iotplatform.module.system.job;

import cn.csg.iotplatform.module.system.service.gk.GkService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;

/**
 *
 */
@Slf4j
@Component
public class GkJob {

    @Resource
    private GkService gkService;

    @Scheduled(cron = "0 0/10 * * * ?")
    @PostConstruct
    public void attachment() {
        try {
            gkService.syncAttachment();
        } catch (Exception e) {
            log.error( "附件同步出错", e);
        }
    }

}
